import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import HomeIndex from '../views/home/HomeIndex.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: Home,
    children: [
      {
        path: 'index',
        component: HomeIndex
      },
      {
        path: 'bookTicket',
        component: () => import('../views/home/BookTicket.vue')
      },
      {
        path: 'personCenter',
        component: () => import('../views/home/PersonCenter.vue')
      },
      {
        path: '',
        redirect: 'index'
      }
    ]
  },
  {
    path: '/publish',
    name: 'publish',
    component: () => import('../views/Publish.vue')
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/Login.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
